using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WebRobot.App_code;

namespace WebRobot.Pages
{
    public partial class login : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
           lbStatus.InnerHtml = "";

           txtUserName.Focus();
           if (IsPostBack)
           {
             lbStatus.InnerHtml = DoLogin(txtUserName.Value.Trim(), txtPassword.Value, true);
             lbStatus.Style.Add(HtmlTextWriterStyle.Color, "RED");

             if (lbStatus.InnerHtml == "Success")
             {
               if (CurrentUser.Role == 1)
                 Response.Redirect("ImportDataPage.aspx");
               if (CurrentUser.Role == 2)
                 Response.Redirect("ApprovedPage.aspx");
             }
           }
        }

    }
}
